﻿using System.Collections.Generic;
using System.Runtime.Serialization;
using System;
using Betop.Lib.Data;
namespace Betop.Lib.Core.User
{
    public partial class UserInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "User";
        }
        public override string GetInsertSql()
        {
            return "insert into [User] ( [ID], [Name], [LoginName], [Password], [Orders], [Status]) values ( @ID, @Name, @LoginName, @Password, @Orders, @Status)";
        }
        public override string GetUpdateSql()
        {
            return "update [User] set  [ID] = @ID, [Name] = @Name, [LoginName] = @LoginName, [Password] = @Password, [Orders] = @Orders, [Status] = @Status where ID = @ID";
        }
        /// <summary>
        /// 主键
        /// </summary>
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String Name
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String LoginName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String Password
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32? Orders
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32? Status
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "loginname":
                    this.LoginName = (String)value;
                    break;
                case "password":
                    this.Password = (String)value;
                    break;
                case "orders":
                    this.Orders = (Int32?)value;
                    break;
                case "status":
                    this.Status = (Int32?)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "loginname":
                    return this.LoginName;
                case "password":
                    return this.Password;
                case "orders":
                    return this.Orders;
                case "status":
                    return this.Status;
                default:
                    return null;
            }
        }
    }

}
